﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace ZoambieGaem {
    class Flashlight {

        static readonly object textureLocker = new object();
        private Texture2D _texture;
        public Texture2D texture {
            get {
                lock (textureLocker) {
                    return _texture;
                }
            }
            set {
                lock (textureLocker) {
                    _texture = value;
                }
            }
        }


        static readonly object angleLocker = new object();
        private float _angle;
        public float angle {
            get {
                lock (angleLocker) {
                    return _angle;
                }
            }
            set {
                lock (angleLocker) {
                    _angle = value;
                }
            }
        }


        static readonly object widthLocker = new object();
        private int _width;
        public int width {
            get {
                lock (widthLocker) {
                    return _width;
                }
            }
            set {
                lock (widthLocker) {
                    _width = value;
                }
            }
        }

        static readonly object heightLocker = new object();
        private int _height;
        public int height {
            get {
                lock (heightLocker) {
                    return _height;
                }
            }
            set {
                lock (heightLocker) {
                    _height = value;
                }
            }
        }

        static readonly object centerXLocker = new object();
        private int _centerX;
        public int centerX {
            get {
                lock (centerXLocker) {
                    return _centerX;
                }
            }
            set {
                lock (centerXLocker) {
                    _centerX = value;
                }
            }
        }

        static readonly object centerYLocker = new object();
        private int _centerY;
        public int centerY {
            get {
                lock (centerYLocker) {
                    return _centerY;
                }
            }
            set {
                lock (centerYLocker) {
                    _centerY = value;
                }
            }
        }



        //placeholder
        //public Vector2 playerDirection;

        //Konstruktööri
        public Flashlight(Texture2D texture, Master m) {
            this._texture = texture;
            this._angle = MathHelper.ToRadians(90);
            this._width = (int)(this.texture.Width * m.drawScale);
            this._height = (int)(this.texture.Height * m.drawScale);
            this._centerX = this.texture.Width / 2;
            this._centerY = this.texture.Height / 2;
        }
    }
}
